package com.dy.controller;

import com.dy.bean.Car;
import com.dy.service.CarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @projectName: day0611
 * @package: com.dy.controller
 * @className: CarController
 * @author: DuanYu
 * @description: TODO
 * @date: 2024/6/11 11:06
 * @version: 1.0
 */
@RestController
public class CarController {
    @Autowired
    CarService carService;
    @RequestMapping("list")
    public List<Car> showCar(String name, String carno){
        return carService.showCar(name,carno);
    }
    @RequestMapping("add")
    public int addCar(Car car){
        return carService.addCar(car);
    }
    @RequestMapping("del")
    public int del(Integer id){
        return carService.del(id);
    }
    @RequestMapping("upd")
    public int update(Car car){
        return carService.update(car);
    }
    @RequestMapping("delall")
    public int delAll(Integer[] ids){
        return carService.delAll(ids);
    }
}
